import types 
import math 

class TypeMapInfo():
    __slots__ = [
        "SqliteType",
        "CppType",
        "CheckFuncName",
    ];
    
    def __init__(self, CppType, SqliteType, CheckFuncName):
        self.CppType = CppType;
        self.SqliteType = SqliteType;
        self.CheckFuncName = CheckFuncName;

    # IntType
    def CheckExeclInt(self, ColumnDatas):
        for index,CellData in enumerate(ColumnDatas):
            bfloat = type(CellData) is float;
            bInt = type(CellData) is int;
            if not (bInt or (bfloat and CellData==math.floor(CellData))):
                return False, index;
        return True, 0;     
       
    # StringType
    def CheckExeclString(self, ColumnDatas):
        return True, 0;     
    
    # FloatType
    def CheckExeclFloat(self, ColumnDatas):
        for index,CellData in enumerate(ColumnDatas):
            if not (type(CellData) is float):
                return False, index;
        return True, 0;   
        
    # BooleanType    
    def CheckExeclBool(self, ColumnDatas):
        for index,CellData in enumerate(ColumnDatas):
            if not (CellData==1 or CellData==0):
                return False, index;
        return True, 0;   









